package com.grf.config;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    /**
     * 监听Topic的变化
     * @param record
     */
    @KafkaListener(topics = {"test"})
    public void listener(ConsumerRecord record) {
        System.out.println(record.topic() + "," + record.offset() + "," + record.value());
    }

}
